import request from '@/utils/request'

/* 字典分页*/
export function selectDictPage(data) {
  return request({
    url: '/system/dict/selectDictPage',
    method: 'post',
    data: data
  })
}

/* 查询所有字典*/
export function selectAllDict() {
  return request({
    url: '/system/dict/selectAllDict',
    method: 'post'
  })
}

/* 通过父key查询*/
export function selectByDictKey(data) {
  return request({
    url: '/system/dict/selectByDictKey/' + data,
    method: 'post'
  })
}

/* 新增字典*/
export function saveDict(data) {
  return request({
    url: '/system/dict/saveDict',
    method: 'post',
    data: data
  })
}

/* 修改字典*/
export function updateDict(data) {
  return request({
    url: '/system/dict/updateDictById',
    method: 'post',
    data: data
  })
}

/* 根据id查询字典*/
export function selectDictById(data) {
  return request({
    url: '/system/dict/selectDictById/' + data,
    method: 'post'
  })
}

/* 删除字典*/
export function deleteDict(data) {
  return request({
    url: '/system/dict/deleteDict',
    method: 'post',
    data: data
  })
}
/* ========================字典详情============================== */
/* 分页查询字典详情*/
export function selectDictItemPage(data) {
  return request({
    url: '/system/dictItem/selectDictItemPage',
    method: 'post',
    data: data
  })
}

/* 新增字典详情*/
export function saveDictItem(data) {
  return request({
    url: '/system/dictItem/saveDictItem',
    method: 'post',
    data: data
  })
}

/* 修改字典详情*/
export function updateDictItem(data) {
  return request({
    url: '/system/dictItem/updateDictItemById',
    method: 'post',
    data: data
  })
}

/* 根据id查询字典详情*/
export function selectDictItemById(data) {
  return request({
    url: '/system/dictItem/selectDictItemById/' + data,
    method: 'post'
  })
}

/* 删除字典详情*/
export function deleteDictItem(data) {
  return request({
    url: '/system/dictItem/deleteDictItem',
    method: 'post',
    data: data
  })
}
